package com.pro.common.api.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.pro.common.api.exception.BusinessBreakException;

public interface IResponse<T, CODE> {
    CODE getCode();

    String getMsg();

    T getData();

    @JsonIgnore
    boolean isSuccess();

    default void throwUnAuthorization() {
        throw new BusinessBreakException(401, "授权已过期_请重新授权_", getMsg());
    }

}
